Skip to content

feat(contracts): M2 Adapter IPC v0.1 contract (JSON-over-stdio) with conformance teeth - #126

Merged
mdheller merged 1 commit into
mainfrom
feat/m2-adapter-ipc-contract
Aug 3, 2026
Merged

feat(contracts): M2 Adapter IPC v0.1 contract (JSON-over-stdio) with conformance teeth#126
mdheller merged 1 commit into
mainfrom
feat/m2-adapter-ipc-contract

Conversation

@mdheller

@mdheller mdheller commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What

Distils the M2 Adapter IPC Spec v0.1 (JSON-over-stdio, Subprocess Plugins) and the M2 Protocol Versioning & Compatibility Spec v0.1 (SourceOS Spec intake 2026-07-31) into an enforceable contract for the contract-runner ⇄ backend-adapter NDJSON protocol. This is the canonical home per the estate's schema+validator+fixtures pattern.

Contents

  • contracts/adapter-ipc.schema.json — draft 2020-12 schema: request/response envelopes, hello handshake, lane config (digest-pinned containers), canonical error-code registry.
  • scripts/validate-adapter-ipc.py — schema + semantic invariants: id correlation, ok/errors coupling (ok:false⇒non-empty, ok:true⇒empty), error-registry membership, MAJOR.MINOR protocol_version, digest-pinned containerized lanes.
  • fixtures/protocol/*.ndjson — 6 accept fixtures (hello_ok, hello_incompatible, lock_hash_ok, task_run_ok, task_run_fail, deps_inventory_ok).
  • fixtures/protocol/_reject/*.ndjson — 8 reject fixtures, each must fire.
  • Wired into make validate (validate-adapter-ipc).
  • docs/architecture/adapter-ipc-contract.md — home + provenance.

Teeth

make validate-adapter-ipc6 accepted, 8 rejected. Negative control confirmed locally: weakening a reject fixture (valid error code) makes the run fail. Full make validate green (exit 0).

Provenance

Source SHA-256 (FIPS 180-4) 59caac80044f046c4b5f37068ba70ab79c336b973f6714f12cdd91c5e7efd9f7.

Deferred (not this slice)

Fixture-replay harness against a live adapter subprocess; capability-negotiation runtime (missing_required fail-fast); reference pixi adapter; length-prefixed framing for streaming (MAJOR bump).

…conformance teeth

Distil the M2 Adapter IPC Spec v0.1 + Protocol Versioning & Compatibility Spec
v0.1 (SourceOS Spec intake 2026-07-31) into an enforceable contract for the
contract-runner <-> backend-adapter NDJSON protocol.

- contracts/adapter-ipc.schema.json: draft 2020-12 schema for request/response
  envelopes, hello handshake, lane config (digest-pinned containers), and the
  canonical error-code registry.
- scripts/validate-adapter-ipc.py: schema + semantic invariants (id correlation,
  ok/errors coupling, error-registry membership, MAJOR.MINOR protocol_version).
- fixtures/protocol: 6 accept + 8 reject fixtures; wired into make validate.
- docs/architecture/adapter-ipc-contract.md: home + provenance (source SHA-256,
  FIPS 180-4).

Teeth: accept fixtures validate; each reject fixture must fire; negative control
confirmed (weakening a reject fixture fails the run). make validate green.
@mdheller
mdheller merged commit feb3a0d into main Aug 3, 2026
3 checks passed
@mdheller
mdheller deleted the feat/m2-adapter-ipc-contract branch August 3, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant